//
//  MakeFriendsInfoViewController.m
//  Liuhe
//
//  Created by zr on 2018/8/13.
//  Copyright © 2018年 zr. All rights reserved.
//

#import "MakeFriendsInfoViewController.h"

@interface MakeFriendsInfoViewController ()

@property (nonatomic, weak)UIScrollView * scrollView;
@property (nonatomic, weak)UIImageView * topIamgeView;
@property (nonatomic, strong)UILabel * titleLabel;
@property (nonatomic, strong)UILabel * timeLabel;
@property (nonatomic, strong)UILabel * careLabel;
@property (nonatomic, strong)UIView * oneLineView;
@property (nonatomic, strong)UIView * twoLineView;
@property (nonatomic, strong)UIView * threeLineView;
@property (nonatomic, strong)UIView * fourLineView;
@property (nonatomic, weak)UIView * greenLineView;
@property (nonatomic, weak)UIView * redLineView;
@property (nonatomic, weak)UILabel * infoLabel;
@property (nonatomic, weak)UILabel * needsLabel;
@property (nonatomic, strong)UILabel * educationLabel;
@property (nonatomic, strong)UILabel * ageLabel;
@property (nonatomic, strong)UILabel * weightLabel;
@property (nonatomic, strong)UILabel * heightLabel;
@property (nonatomic, strong)UILabel * nameLabel;
@property (nonatomic, strong)UILabel * homeLabel;
@property (nonatomic, strong)UILabel * telLabel;
@property (nonatomic, strong)UILabel * emailLabel;
@property (nonatomic, strong)UILabel * eduationValueLabel;
@property (nonatomic, strong)UILabel * ageValueLabel;
@property (nonatomic, strong)UILabel * weightValueLabel;
@property (nonatomic, strong)UILabel * heightValueLabel;
@property (nonatomic, strong)UILabel * nameValueLabel;
@property (nonatomic, strong)UILabel * homeValueLabel;
@property (nonatomic, strong)UILabel * telValueLabel;
@property (nonatomic, strong)UILabel * emailValueLabel;
@property (nonatomic, strong)UILabel * educatNeedsLabel;
@property (nonatomic, strong)UILabel * ageNeedsLabel;
@property (nonatomic, strong)UILabel * moneyNeedsLabel;
@property (nonatomic, strong)UILabel * educatNeedsValueLabel;
@property (nonatomic, strong)UILabel * ageNeedsValueLabel;
@property (nonatomic, strong)UILabel * moneyNeedsValueLabel;
@property (nonatomic, strong)UILabel * houseNeedsLabel;
@property (nonatomic, strong)UILabel * heightNeedsLabel;
@property (nonatomic, strong)UILabel * jobNeedsLabel;
@property (nonatomic, strong)UILabel * houseNeedsValueLabel;
@property (nonatomic, strong)UILabel * heightNeedsValueLabel;
@property (nonatomic, strong)UILabel * jobNeedsValueLabel;
@property (nonatomic, weak)UITextView * textView;
@property (nonatomic, weak)UILabel * redLabel;
@property (nonatomic, strong)UIButton * leftButton;
@property (nonatomic, strong)UIButton * rightButton;

@end

@implementation MakeFriendsInfoViewController


- (void)viewWillAppear:(BOOL)animated{
    
    NSDictionary * dict = @{@"id":self.ID};
    
    [[NetworkTool sharedTools] POST:@"/index/Liuheonline/friendDetails" parameters:dict progress:nil success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
        
//        NSLog(@"res=====%@",responseObject);
      
        int status = [responseObject[@"status"] intValue];
        
        if (status == 200) {
        
            NSDictionary * data = responseObject[@"data"];
            NSArray * arr = data[@"headimg"];
            NSURL * url = [NSURL URLWithString:arr.firstObject];
//            NSLog(@"url===%@",url);
            [self.topIamgeView sd_setImageWithURL:url];
            self.titleLabel.text = data[@"title"];
            // timeStampString 是服务器返回的13位时间戳
            NSString *timeStampString  = data[@"ctime"];

            // iOS 生成的时间戳是10位
            NSTimeInterval interval    =[timeStampString doubleValue];
            NSDate *date               = [NSDate dateWithTimeIntervalSince1970:interval];

            NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
            [formatter setDateFormat:@"yyyy-MM-dd"];
            NSString *dateString       = [formatter stringFromDate: date];
            self.timeLabel.text = [NSString stringWithFormat:@"发布时间：%@",dateString];
            self.careLabel.text = [NSString stringWithFormat:@"关注度：%@",data[@"follow"]];
            self.eduationValueLabel.text = data[@"education"];
            self.ageValueLabel.text = [NSString stringWithFormat:@"%@",data[@"age"]];
            self.weightValueLabel.text = [NSString stringWithFormat:@"%@",data[@"weight"]];
            self.heightValueLabel.text = [NSString stringWithFormat:@"%@",data[@"height"]];
            self.nameValueLabel.text = data[@"name"];
            self.homeValueLabel.text = data[@"address"];
            self.telValueLabel.text = [NSString stringWithFormat:@"%@",data[@"mobile"]];
            self.emailValueLabel.text = [NSString stringWithFormat:@"%@",data[@"email"]];
            self.educatNeedsValueLabel.text = data[@"require_education"];
            self.ageNeedsValueLabel.text = [NSString stringWithFormat:@"%@",data[@"require_age"]];
            self.moneyNeedsValueLabel.text = [NSString stringWithFormat:@"%@",data[@"require_income"]];
            self.houseNeedsValueLabel.text = [NSString stringWithFormat:@"%@",data[@"require_house"]];
            self.heightNeedsValueLabel.text = [NSString stringWithFormat:@"%@",data[@"require_height"]];
            
//            if([[data allKeys] containsObject:@"signature"])
//            {
//                self.textView.text = data[@"signature"];
//            }
            NSString * str = data[@"signature"];
            
            if ([str isKindOfClass:[NSNull class]]) {
                
            }else{
                self.textView.text = data[@"signature"];
            }
        }
        
    } failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
        
    }];
}


- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    self.view.backgroundColor = WHITE_COLOR;
    
    [self setupNav];
    [self setupUI];
    
}


- (void)setupNav{
    
    self.title = @"交友详情";
    
    UIButton * backButton = [[UIButton alloc] init];
    
    backButton.frame = CGRectMake(0, 0, 12 * SCREENH6, 20 * SCREENH6);
    [backButton setImage:[UIImage imageNamed:@"1返回"] forState:UIControlStateNormal];
    [backButton addTarget:self action:@selector(backToView) forControlEvents:UIControlEventTouchUpInside];
    
    UIBarButtonItem * leftButton = [[UIBarButtonItem alloc] initWithCustomView:backButton];
    
    self.navigationItem.leftBarButtonItem = leftButton;
    
}

- (void)backToView{
    
    [self.navigationController popViewControllerAnimated:YES];
}


- (void)setupUI{
    
    UIScrollView * scrollView = [[UIScrollView alloc] initWithFrame:self.view.bounds];

    scrollView.bounces = NO;
//    scrollView.scrollEnabled = YES;
    scrollView.alwaysBounceVertical = YES;
    scrollView.alwaysBounceHorizontal = NO;
    scrollView.showsVerticalScrollIndicator = NO;
    scrollView.showsHorizontalScrollIndicator = NO;
    scrollView.contentSize = CGSizeMake(SCREEN_WIDTH, SCREENH_HEIGHT + 352 * SCREENH6);
//    scrollView.userInteractionEnabled = YES;
    
    self.scrollView = scrollView;
    
    [self.view addSubview:self.scrollView];
    
    
    UIImageView * topImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, 200 * SCREENH6)];
    
    topImageView.backgroundColor = [UIColor lightGrayColor];
    
    self.topIamgeView = topImageView;
    
    [self.scrollView addSubview:self.topIamgeView];
    
    
    UILabel * titleLabel = [UILabel new];
    
    titleLabel.text = @"90后妹子找男朋友来谈恋爱";
    titleLabel.textColor = BLACK_COLOR;
    titleLabel.font = [UIFont systemFontOfSize:18 * SCREENH6];
    
    self.titleLabel = titleLabel;
    
    [self.scrollView addSubview:self.titleLabel];
    
    
    self.timeLabel = [self setupLabelWith:@"发布时间：2018-07-29" type:@"normal"];
    [self.scrollView addSubview:self.timeLabel];
    
    self.careLabel = [self setupLabelWith:@"关注度：840" type:@"normal"];
    [self.scrollView addSubview:self.careLabel];
    
    self.oneLineView = [self setupLineView];
    [self.scrollView addSubview:self.oneLineView];
    
    
    UIView * greenView = [UIView new];
    
    greenView.backgroundColor = ColorWithRGB(0x1FB6A4);
    
    self.greenLineView = greenView;
    
    [self.scrollView addSubview:self.greenLineView];
    
    
    UILabel * infoLabel = [UILabel new];
    
    infoLabel.text = @"个人信息";
    infoLabel.textColor = ColorWithRGB(0xB3B3B3);
    infoLabel.font = [UIFont systemFontOfSize:15 * SCREENH6];
    
    self.infoLabel = infoLabel;
    
    [self.scrollView addSubview:self.infoLabel];
    
    self.twoLineView = [self setupLineView];
    [self.scrollView addSubview:self.twoLineView];
    
    
    self.educationLabel = [self setupLabelWith:@"学历：" type:@"normal"];
    [self.scrollView addSubview:self.educationLabel];
    
    self.ageLabel = [self setupLabelWith:@"年龄：" type:@"normal"];
    [self.scrollView addSubview:self.ageLabel];
    
    self.weightLabel = [self setupLabelWith:@"体重：" type:@"normal"];
    [self.scrollView addSubview:self.weightLabel];
    
    self.heightLabel = [self setupLabelWith:@"身高：" type:@"normal"];
    [self.scrollView addSubview:self.heightLabel];
    
    self.nameLabel = [self setupLabelWith:@"姓名：" type:@"normal"];
    [self.scrollView addSubview:self.nameLabel];
    
    self.homeLabel = [self setupLabelWith:@"家乡：" type:@"normal"];
    [self.scrollView addSubview:self.homeLabel];
    
    self.telLabel = [self setupLabelWith:@"电话：" type:@"normal"];
    [self.scrollView addSubview:self.telLabel];
    
    self.emailLabel = [self setupLabelWith:@"邮箱：" type:@"normal"];
    [self.scrollView addSubview:self.emailLabel];
    
    self.eduationValueLabel = [self setupLabelWith:@"大专" type:@"black"];
    [self.scrollView addSubview:self.eduationValueLabel];
    
    self.ageValueLabel = [self setupLabelWith:@"22" type:@"black"];
    [self.scrollView addSubview:self.ageValueLabel];
    
    self.weightValueLabel = [self setupLabelWith:@"55kg" type:@"black"];
    [self.scrollView addSubview:self.weightValueLabel];
    
    self.heightValueLabel = [self setupLabelWith:@"180cm" type:@"black"];
    [self.scrollView addSubview:self.heightValueLabel];
    
    self.nameValueLabel = [self setupLabelWith:@"保密" type:@"black"];
    [self.scrollView addSubview:self.nameValueLabel];
    
    self.homeValueLabel = [self setupLabelWith:@"成都" type:@"black"];
    [self.scrollView addSubview:self.homeValueLabel];
    
    self.telValueLabel = [self setupLabelWith:@"保密" type:@"black"];
    [self.scrollView addSubview:self.telValueLabel];
    
    self.emailValueLabel = [self setupLabelWith:@"12345695@163.com" type:@"black"];
    [self.scrollView addSubview:self.emailValueLabel];
    
    self.threeLineView = [self setupLineView];
    [self.scrollView addSubview:self.threeLineView];
    
    
    UIView * redView = [UIView new];
    
    redView.backgroundColor = ColorWithRGB(0xE02E2D);
    
    self.redLineView = redView;
    
    [self.scrollView addSubview:self.redLineView];
    
    
    UILabel * needsLabel = [UILabel new];
    
    needsLabel.text = @"交友要求";
    needsLabel.textColor = ColorWithRGB(0xB3B3B3);
    needsLabel.font = [UIFont systemFontOfSize:15 * SCREENH6];
    
    self.needsLabel = needsLabel;
    
    [self.scrollView addSubview:self.needsLabel];
    
    self.fourLineView = [self setupLineView];
    [self.scrollView addSubview:self.fourLineView];
    

    self.educatNeedsLabel = [self setupLabelWith:@"学历要求：" type:@"normal"];
    [self.scrollView addSubview:self.educatNeedsLabel];
    
    self.ageNeedsLabel = [self setupLabelWith:@"年龄要求：" type:@"normal"];
    [self.scrollView addSubview:self.ageNeedsLabel];
    
    self.moneyNeedsLabel = [self setupLabelWith:@"收入要求：" type:@"normal"];
    [self.scrollView addSubview:self.moneyNeedsLabel];
    
    self.houseNeedsLabel = [self setupLabelWith:@"住房要求：" type:@"normal"];
    [self.scrollView addSubview:self.houseNeedsLabel];
    
    self.heightNeedsLabel = [self setupLabelWith:@"身高要求：" type:@"normal"];
    [self.scrollView addSubview:self.heightNeedsLabel];
    
    self.jobNeedsLabel = [self setupLabelWith:@"职业要求：" type:@"normal"];
    [self.scrollView addSubview:self.jobNeedsLabel];
    
    self.educatNeedsValueLabel = [self setupLabelWith:@"大专" type:@"black"];
    [self.scrollView addSubview:self.educatNeedsValueLabel];
    
    self.ageNeedsValueLabel = [self setupLabelWith:@"22 - 35" type:@"black"];
    [self.scrollView addSubview:self.ageNeedsValueLabel];
    
    self.moneyNeedsValueLabel = [self setupLabelWith:@"不限" type:@"black"];
    [self.scrollView addSubview:self.moneyNeedsValueLabel];
    
    self.houseNeedsValueLabel = [self setupLabelWith:@"不限" type:@"black"];
    [self.scrollView addSubview:self.houseNeedsValueLabel];
    
    self.heightNeedsValueLabel = [self setupLabelWith:@"172-185" type:@"black"];
    [self.scrollView addSubview:self.heightNeedsValueLabel];
    
    self.jobNeedsValueLabel = [self setupLabelWith:@"不限" type:@"black"];
    [self.scrollView addSubview:self.jobNeedsValueLabel];
    
    
    UITextView *textView =[[UITextView alloc] init];
    textView.backgroundColor= [UIColor whiteColor];
//    textView.text = data[@"content"];
    textView.textColor = [UIColor blackColor];
    textView.editable = NO;
    textView.font = [UIFont systemFontOfSize:13 * SCREENH6];
    
    self.textView = textView;
    
    [self.scrollView addSubview:self.textView];
    
    self.leftButton = [self setupButtonWith:@"wewq3"];
    [self.scrollView addSubview:self.leftButton];
    
    self.rightButton = [self setupButtonWith:@"erwrew32"];
    [self.scrollView addSubview:self.rightButton];
}


- (void)viewDidLayoutSubviews{
    
//    [self.topIamgeView mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.top.leading.trailing.mas_equalTo(self.scrollView);
//        make.height.mas_equalTo(200 * SCREENH6);
//    }];
    
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.scrollView).offset(15 * SCREENH6);
        make.top.mas_equalTo(self.topIamgeView.mas_bottom).offset(12 * SCREENH6);
    }];
    
    [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.titleLabel);
        make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(10 * SCREENH6);
    }];
    
    [self.careLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.timeLabel);
        make.leading.mas_equalTo(self.timeLabel.mas_trailing).offset(20 * SCREENH6);
    }];
    
    [self.oneLineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.trailing.mas_equalTo(self.view);
        make.height.mas_equalTo(2 * SCREENH6);
        make.top.mas_equalTo(self.careLabel.mas_bottom).offset(20 * SCREENH6);
    }];
    
    [self.twoLineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.trailing.mas_equalTo(self.oneLineView);
        make.height.mas_equalTo(1 * SCREENH6);
        make.top.mas_equalTo(self.oneLineView.mas_bottom).offset(55 * SCREENH6);
    }];
    
    [self.greenLineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.mas_equalTo(5 * SCREENH6);
        make.top.mas_equalTo(self.oneLineView.mas_bottom).offset(10 * SCREENH6);
        make.bottom.mas_equalTo(self.twoLineView.mas_top).offset(-10 * SCREENH6);
        make.leading.mas_equalTo(self.view).offset(15 * SCREENH6);
    }];
    
    [self.infoLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.greenLineView);
        make.leading.mas_equalTo(self.greenLineView.mas_trailing).offset(5 * SCREENH6);
    }];
    
    [self.educationLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.greenLineView);
        make.top.mas_equalTo(self.twoLineView.mas_bottom).offset(15 * SCREENH6);
    }];
    
    [self.eduationValueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.educationLabel);
        make.leading.mas_equalTo(self.educationLabel.mas_trailing);
    }];
    
    [self.ageLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.eduationValueLabel.mas_trailing).offset(85 * SCREENH6);
        make.centerY.mas_equalTo(self.eduationValueLabel);
    }];
    
    [self.ageValueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.ageLabel);
        make.leading.mas_equalTo(self.ageLabel.mas_trailing);
    }];
    
    [self.weightLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.educationLabel);
        make.top.mas_equalTo(self.educationLabel.mas_bottom).offset(15 * SCREENH6);
    }];
    
    [self.weightValueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.weightLabel);
        make.leading.mas_equalTo(self.weightLabel.mas_trailing);
    }];
    
    [self.heightLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.ageLabel);
        make.centerY.mas_equalTo(self.weightValueLabel);
    }];
    
    [self.heightValueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.heightLabel);
        make.leading.mas_equalTo(self.heightLabel.mas_trailing);
    }];
    
    [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.weightLabel);
        make.top.mas_equalTo(self.weightLabel.mas_bottom).offset(15 * SCREENH6);
    }];
    
    [self.nameValueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.nameLabel);
        make.leading.mas_equalTo(self.nameLabel.mas_trailing);
    }];
    
    [self.homeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.heightLabel);
        make.centerY.mas_equalTo(self.nameValueLabel);
    }];
    
    [self.homeValueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.homeLabel);
        make.leading.mas_equalTo(self.homeLabel.mas_trailing);
    }];
    
    [self.telLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.nameLabel);
        make.top.mas_equalTo(self.nameLabel.mas_bottom).offset(15 * SCREENH6);
    }];
    
    [self.telValueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.telLabel);
        make.leading.mas_equalTo(self.telLabel.mas_trailing);
    }];
    
    [self.emailLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.homeLabel);
        make.centerY.mas_equalTo(self.telValueLabel);
    }];
    
    [self.emailValueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.emailLabel);
        make.leading.mas_equalTo(self.emailLabel.mas_trailing);
    }];
    
    [self.threeLineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.trailing.height.mas_equalTo(self.oneLineView);
        make.top.mas_equalTo(self.telLabel.mas_bottom).offset(15 * SCREENH6);
    }];
    
    [self.fourLineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.trailing.height.mas_equalTo(self.twoLineView);
        make.top.mas_equalTo(self.threeLineView.mas_bottom).offset(58 * SCREENH6);
    }];
    
    [self.redLineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.width.mas_equalTo(self.greenLineView);
        make.top.mas_equalTo(self.threeLineView.mas_bottom).offset(13 * SCREENH6);
        make.bottom.mas_equalTo(self.fourLineView.mas_top).offset(-10 * SCREENH6);
    }];
    
    [self.needsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.infoLabel);
        make.centerY.mas_equalTo(self.redLineView);
    }];
    
    [self.educatNeedsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.fourLineView.mas_bottom).offset(15 * SCREENH6);
        make.leading.mas_equalTo(self.redLineView);
    }];
    
    [self.educatNeedsValueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.educatNeedsLabel.mas_trailing);
        make.centerY.mas_equalTo(self.educatNeedsLabel);
    }];
    
    [self.ageNeedsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.educatNeedsValueLabel);
        make.leading.mas_equalTo(self.emailLabel);
    }];
    
    [self.ageNeedsValueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.ageNeedsLabel.mas_trailing);
        make.centerY.mas_equalTo(self.ageNeedsLabel);
    }];
    
    [self.moneyNeedsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.educatNeedsLabel);
        make.top.mas_equalTo(self.educatNeedsLabel.mas_bottom).offset(15 * SCREENH6);
    }];
    
    [self.moneyNeedsValueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.moneyNeedsLabel);
        make.leading.mas_equalTo(self.moneyNeedsLabel.mas_trailing);
    }];
    
    [self.houseNeedsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.ageNeedsLabel);
        make.centerY.mas_equalTo(self.moneyNeedsValueLabel);
    }];
    
    [self.houseNeedsValueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.houseNeedsLabel);
        make.leading.mas_equalTo(self.houseNeedsLabel.mas_trailing);
    }];
    
    [self.heightNeedsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.moneyNeedsLabel);
        make.top.mas_equalTo(self.moneyNeedsLabel.mas_bottom).offset(15 * SCREENH6);
    }];
    
    [self.heightNeedsValueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.heightNeedsLabel);
        make.leading.mas_equalTo(self.heightNeedsLabel.mas_trailing);
    }];
    
    [self.jobNeedsLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.houseNeedsLabel);
        make.centerY.mas_equalTo(self.heightNeedsValueLabel);
    }];
    
    [self.jobNeedsValueLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.mas_equalTo(self.jobNeedsLabel);
        make.leading.mas_equalTo(self.jobNeedsLabel.mas_trailing);
    }];
    
    [self.textView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.heightNeedsLabel);
        make.trailing.mas_equalTo(self.view).offset(-15 * SCREENH6);
        make.height.mas_equalTo(250 * SCREENH6);
        make.top.mas_equalTo(self.heightNeedsLabel.mas_bottom).offset(15 * SCREENH6);
    }];
    
    [self.leftButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.mas_equalTo(self.view);
        make.width.mas_equalTo(SCREEN_WIDTH / 2);
        make.height.mas_equalTo(50 * SCREENH6);
        make.top.mas_equalTo(self.textView.mas_bottom).offset(30 * SCREENH6);
    }];

    [self.rightButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.width.height.centerY.mas_equalTo(self.leftButton);
        make.trailing.mas_equalTo(self.view);
    }];
}



- (void)clickBottomButton:(UIButton *)button{
    
    if (button == self.rightButton) {
        
        NSString * tel = [NSString stringWithFormat:@"tel:%@",self.telValueLabel.text];
        
        UIWebView * callWebview = [[UIWebView alloc]init];
        
        [callWebview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:tel]]];
        
        [[UIApplication sharedApplication].keyWindow addSubview:callWebview];
    }
}


-(UIButton *)setupButtonWith:(NSString *)iamges{
    
    UIButton * button = [UIButton new];
    
    [button setImage:ImageNamed(iamges) forState:UIControlStateNormal];
    [button addTarget:self action:@selector(clickBottomButton:) forControlEvents:UIControlEventTouchUpInside];
    
    return button;
}


- (UILabel *)setupLabelWith:(NSString *)string type:(NSString *)type{
    
    UILabel * label = [UILabel new];
    
    label.text = string;
    
    if ([type isEqualToString:@"normal"]) {
        
        label.textColor = ColorWithRGB(0xB3B3B3);
    }else if ([type isEqualToString:@"black"]){
        
        label.textColor = BLACK_COLOR;
    }
    
    label.font = [UIFont systemFontOfSize:13 * SCREENH6];
    
    return label;
}


- (UIView *)setupLineView{
    
    UIView * lineView = [UIView new];
    
    lineView.backgroundColor = ColorWithRGB(0xE6E6E6);
    
    
    return lineView;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
